import { api, dataHandler } from '../utils/http';
// import 'mock/getReadMock';
// import 'mock/getUnreadMock';
// import 'mock/getSentMock';
// import 'mock/readAllMock';
// import 'mock/readMock';

const url = '/api/message';

const getReadMessage = () => api.get(`${url}/read`).then(dataHandler);

const getUnreadMessage = () => api.get(`${url}/unread`).then(dataHandler);

// const getMessage = () => api.get(url).then(dataHandler);

const getSentMessage = () => api.get(`${url}/sent`).then(dataHandler);

const readMessage = (data) => api.put(`${url}/${data}`).then(dataHandler);

const readAllMessage = () => api.put('/api/allMessage/').then(dataHandler);

export {
  getReadMessage,
  getUnreadMessage,
  // getMessage,
  getSentMessage,
  readMessage,
  readAllMessage,
};
